let db = require('../db/index')

exports.getList = (req,res) => {

  const sql = 'select * from article order by commentsCount desc limit 3'
  db.query(sql, (err, data) => {
    if (err) {
      return res.send('获取失败' + err.message)
    }
    res.send({
      code: 20000,
      data: data
    })
  })
}